package com.jsyh.maidu.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.jsyh.maidu.R;
import com.jsyh.maidu.config.ConfigValue;
import com.jsyh.maidu.model.SuppinfoModel;
import com.squareup.picasso.Picasso;

/**
 * Created by admin on 2017/7/17.
 */

public class StoreDetailFragment extends BaseFragment {

    TextView tv_name,tv_rank,tv_description,tv_shopservice,tv_transservice,tv_num,tv_time,tv_address,tv_city;
    Button btn_connect;
    ImageView iv_shop;
    View view;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        view=inflater.inflate(R.layout.fragment_store_detail,null);
        return view;
    }
    @Override
    protected void initTitle() {
        //super.initTitle();
    }

    @Override
    protected void initView() {

        tv_name= (TextView) view.findViewById(R.id.tv_fsd_name);
        tv_rank= (TextView) view.findViewById(R.id.tv_fsd_rank);
        tv_description= (TextView) view.findViewById(R.id.tv_fsd_description);
        tv_shopservice= (TextView) view.findViewById(R.id.tv_fsd_shopservice);
        tv_transservice= (TextView) view.findViewById(R.id.tv_fsd_transservice);
        tv_num= (TextView) view.findViewById(R.id.tv_fsd_num);
        tv_time= (TextView) view.findViewById(R.id.tv_fsd_time);
        tv_address= (TextView) view.findViewById(R.id.tv_fsd_address);
        tv_city= (TextView) view.findViewById(R.id.tv_fsd_city);
        iv_shop= (ImageView) view.findViewById(R.id.iv_fsd_pic);




    }

    public void setdetailData(SuppinfoModel.SupplierInfo model)
    {
        tv_name.setText(model.getSupplier_name());
        tv_description.setText("宝贝描述："+model.getDistrict());
        tv_rank.setText("店铺等级："+model.getComment_rank());
        tv_address.setText("详细地址："+model.getAddress());
        tv_city.setText("所在地："+model.getCity());
        tv_num.setText("商品数量："+model.getNumber());
        tv_shopservice.setText("卖家服务:"+model.getServer());
        tv_time.setText("开店时间："+model.getAdd_time());
        tv_transservice.setText("物流服务："+model.getShipping());

        Picasso.with(getContext()).load(ConfigValue.IMG_IP+model.getLogo()).into(iv_shop);

    }
}
